import Cart from './Cart';
import Course from './Course';

import Observer from '../../utils/Observer';


//管理主购物车功能模块
export default class ShoppingCart {
  constructor() {
    this.oList = document.getElementsByClassName('J_list')[0];
    this.oCart = document.getElementsByClassName('J_cart')[0];
    //实例化观察者
    this.observer = new Observer();

  }

  init() {
    //传入实例化后的观察者
    new Cart(this.oCart, this.observer).init();
    new Course(this.oList, this.observer).init();
  }
}